package spitfire.ksim.data;

import java.util.ArrayList;
import java.util.List;

public class TSDEstablishData {
	
	public class EstablishEntry {
		public String sensorType;
		public String sensorSd;
		public KSensorSnapshot snapshot;
		
		public EstablishEntry(String sensorType, String sensorSD, KSensorSnapshot snapshot) {
			this.sensorType = sensorType;
			this.sensorSd = sensorSD;
			this.snapshot = snapshot;
		}
		
		@Override
		public String toString() {
			StringBuilder builder = new StringBuilder();
			builder.append("[");
			builder.append(sensorType);
			builder.append(", ");
			builder.append(sensorSd);
			builder.append(", ");
			builder.append(snapshot);
			builder.append("]");
			return builder.toString();
		}
	}
	
	private String nodeId;
	private List<EstablishEntry> entryList = new ArrayList<EstablishEntry>();

	public TSDEstablishData(String nodeId) {
		this.nodeId = nodeId;
	}
	
	public void addSensorSnapshot(String sensorType, String sensorSd,
			KSensorSnapshot snapshot) {
		entryList.add(new EstablishEntry(sensorType, sensorSd, snapshot));
	}
	
	public List<EstablishEntry> getData() {
		return entryList;
	}
	
	public String getNodeId() {
		return nodeId;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("TSDEstablishData [nodeId=");
		builder.append(nodeId);
		builder.append(", data=");
		builder.append(entryList);
		builder.append("]");
		return builder.toString();
	}
}
